// import useCommonStore from '/@/store/modules/common';
// import { storeToRefs } from 'pinia';
// let pinia = useCommonStore();
// let { locale  } = storeToRefs(pinia);

import { createI18n } from 'vue-i18n';
import zh_CN from './lang/zh-CN';
import en_US from './lang/en-US';

//注册i8n实例并引入语言文件
const i18n = createI18n({
  legacy: false,
  globalInjection: true,
  locale: localStorage.getItem('language') == null ? 'zh_CN' : String(localStorage.getItem('language')),
  messages: {
    zh_CN,
    en_US,
  },
});

export default i18n; //将i18n暴露出去，在main.ts中引入挂载
